HA$PBExportHeader$w_arg_rep_listaprecio.srw
forward
global type w_arg_rep_listaprecio from w_arg_report
end type
type st_1 from statictext within w_arg_rep_listaprecio
end type
type st_2 from statictext within w_arg_rep_listaprecio
end type
type dp_fini from datepicker within w_arg_rep_listaprecio
end type
type st_3 from statictext within w_arg_rep_listaprecio
end type
type st_4 from statictext within w_arg_rep_listaprecio
end type
type dp_ffin from datepicker within w_arg_rep_listaprecio
end type
type ddlb_almacen from uo_middlb within w_arg_rep_listaprecio
end type
type ddlb_item from uo_middlb within w_arg_rep_listaprecio
end type
type ddlb_transaccion from uo_middlb within w_arg_rep_listaprecio
end type
type st_5 from statictext within w_arg_rep_listaprecio
end type
end forward

global type w_arg_rep_listaprecio from w_arg_report
integer width = 2258
integer height = 536
string title = "Reportes de Kardex por Materiales o Items"
integer transparency = 10
windowanimationstyle openanimation = centeranimation!
windowanimationstyle closeanimation = centeranimation!
st_1 st_1
st_2 st_2
dp_fini dp_fini
st_3 st_3
st_4 st_4
dp_ffin dp_ffin
ddlb_almacen ddlb_almacen
ddlb_item ddlb_item
ddlb_transaccion ddlb_transaccion
st_5 st_5
end type
global w_arg_rep_listaprecio w_arg_rep_listaprecio

type variables
string isa_alma[],is_alma,isa_item[],is_item,isa_trans[] ,is_trans

end variables

forward prototypes
public subroutine wf_ejecutar_reporte ()
end prototypes

public subroutine wf_ejecutar_reporte ();Datetime ldt_fecini,ldt_fecfin
string ls_titulo_fecha
ldt_fecini =datetime(date(dp_fini.text),time('00:00:00'))
ldt_fecfin = datetime(date(dp_ffin.text),time('23:59:59'))
istr_parm.dw_parm[1].Retrieve(istr_parm.integer_parm[1],istr_parm.integer_parm[2],0)
//integer(is_trans),ldt_fecini,ldt_fecfin)

ls_titulo_fecha = 'DESDE ' + STRING(ldt_fecini,'DD/MM/YYYY') + ' AL ' + STRING(ldt_fecfin,'DD/MM/YYYY HH:MM:SS')

istr_parm.dw_parm[1].object.t_titulo1.text =ls_titulo_fecha
end subroutine

on w_arg_rep_listaprecio.create
int iCurrent
call super::create
this.st_1=create st_1
this.st_2=create st_2
this.dp_fini=create dp_fini
this.st_3=create st_3
this.st_4=create st_4
this.dp_ffin=create dp_ffin
this.ddlb_almacen=create ddlb_almacen
this.ddlb_item=create ddlb_item
this.ddlb_transaccion=create ddlb_transaccion
this.st_5=create st_5
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.st_1
this.Control[iCurrent+2]=this.st_2
this.Control[iCurrent+3]=this.dp_fini
this.Control[iCurrent+4]=this.st_3
this.Control[iCurrent+5]=this.st_4
this.Control[iCurrent+6]=this.dp_ffin
this.Control[iCurrent+7]=this.ddlb_almacen
this.Control[iCurrent+8]=this.ddlb_item
this.Control[iCurrent+9]=this.ddlb_transaccion
this.Control[iCurrent+10]=this.st_5
end on

on w_arg_rep_listaprecio.destroy
call super::destroy
destroy(this.st_1)
destroy(this.st_2)
destroy(this.dp_fini)
destroy(this.st_3)
destroy(this.st_4)
destroy(this.dp_ffin)
destroy(this.ddlb_almacen)
destroy(this.ddlb_item)
destroy(this.ddlb_transaccion)
destroy(this.st_5)
end on

event open;call super::open;istr_parm.integer_parm[1]=0
istr_parm.integer_parm[2]=0
ddlb_almacen.selectitem( 1)
ddlb_item.selectitem( 1)
ddlb_transaccion.selectitem( 1)


end event

type cb_2 from w_arg_report`cb_2 within w_arg_rep_listaprecio
integer x = 1801
integer y = 296
end type

type cb_1 from w_arg_report`cb_1 within w_arg_rep_listaprecio
integer x = 1353
integer y = 296
end type

type dw_1 from w_arg_report`dw_1 within w_arg_rep_listaprecio
boolean visible = false
integer x = 69
integer y = 940
integer width = 407
integer height = 112
end type

type st_1 from statictext within w_arg_rep_listaprecio
integer x = 18
integer y = 40
integer width = 430
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Lista de Precios:"
boolean focusrectangle = false
end type

type st_2 from statictext within w_arg_rep_listaprecio
integer x = 18
integer y = 140
integer width = 329
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Materiales:"
boolean focusrectangle = false
end type

type dp_fini from datepicker within w_arg_rep_listaprecio
boolean visible = false
integer x = 576
integer y = 364
integer width = 594
integer height = 84
integer taborder = 50
boolean bringtotop = true
boolean border = true
borderstyle borderstyle = stylelowered!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2011-03-14"), Time("16:56:31.000000"))
integer textsize = -8
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

type st_3 from statictext within w_arg_rep_listaprecio
boolean visible = false
integer x = 18
integer y = 376
integer width = 379
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Fecha Inicial:"
boolean focusrectangle = false
end type

type st_4 from statictext within w_arg_rep_listaprecio
boolean visible = false
integer x = 18
integer y = 484
integer width = 334
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Fecha Final:"
boolean focusrectangle = false
end type

type dp_ffin from datepicker within w_arg_rep_listaprecio
boolean visible = false
integer x = 576
integer y = 472
integer width = 585
integer height = 80
integer taborder = 40
boolean bringtotop = true
boolean border = true
borderstyle borderstyle = stylelowered!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2011-03-14"), Time("16:56:31.000000"))
integer textsize = -8
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

type ddlb_almacen from uo_middlb within w_arg_rep_listaprecio
integer x = 562
integer y = 20
integer width = 1659
boolean bringtotop = true
end type

event constructor;call super::constructor;ddlb_almacen.event ue_rellena('select idlista,tdesc from mlistaprecio order by 1 asc')
end event

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[1]=integer(isa_alma[index] )

//ddlb_item.reset( )
//ddlb_item.event ue_rellena('select distinct a.iditem,i.tDescCorta from mitem i , mitemalma a where i.iditem = a.iditem and  a.idalma = case "'+string(istr_parm.integer_parm[1])+'" when 0 then a.idalma else   "'+string(istr_parm.integer_parm[1])+'"  end order by 2 asc')
end event

event ue_rellena;long ll_indice= 1
string ls_campo[]

setpointer(hourglass!)
isa_alma[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++


prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_alma[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_alma[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

type ddlb_item from uo_middlb within w_arg_rep_listaprecio
integer x = 562
integer y = 132
integer width = 1655
integer taborder = 20
boolean bringtotop = true
end type

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[2]=integer(isa_item[index] )
end event

event ue_rellena;


long ll_indice= 1


setpointer(hourglass!)
isa_item[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++

prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_item[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_item[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

event constructor;call super::constructor;ddlb_item.reset( )
ddlb_item.event ue_rellena('select distinct a.iditem,i.tDescCorta from mitem i , mlistapreciod a where i.iditem = a.iditem  order by 2 asc')
end event

type ddlb_transaccion from uo_middlb within w_arg_rep_listaprecio
boolean visible = false
integer y = 540
integer width = 1641
integer taborder = 30
boolean bringtotop = true
end type

event constructor;call super::constructor;this.event ue_rellena('select idtrans,tdesc from mtipotrans order by 2 asc')
end event

event ue_rellena;long ll_indice= 1


setpointer(hourglass!)
isa_trans[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++



prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_trans[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_trans[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)



end event

event selectionchanged;call super::selectionchanged;is_trans= isa_trans[index]
end event

type st_5 from statictext within w_arg_rep_listaprecio
boolean visible = false
integer x = 18
integer y = 264
integer width = 539
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Tipo de Transacci$$HEX1$$f300$$ENDHEX$$n:"
boolean focusrectangle = false
end type

